package org.sfx.rich

import javafx.scene.Scene
import javafx.stage.Window
import org.sfx.geometry.Point2D
import org.sfx.rich.Enrich._
import org.sfx.geometry.Bounds2D
import org.sfx.geometry.Dimensions2D

class RichScene(underlying: Scene) {
  def window: Option[Window] = Option(underlying.getWindow())
  
  def minPoint: Point2D = Point2D(underlying.getX(), underlying.getY())
  
  def dimensions: Dimensions2D = Dimensions2D(underlying.getWidth(), underlying.getHeight())

  def minPointFromScreen: Option[Point2D] = window.map(_.minPoint + minPoint)
  
  def bounds: Bounds2D = Bounds2D(minPoint, dimensions)
  
  def boundsFromScreen: Option[Bounds2D] = underlying.window.map { bounds + _.minPoint }
}
